<%@ LANGUAGE="VBSCRIPT" %>
<%'  ------------------------------------------------------------
  '  version.asp 
  '  ------------------------------------------------------------
  '  VCS INFO:
  '  
  '  $Revision:   1.1  $
  '  $Date:   08 Oct 1998 16:06:44  $
  '  $Author:   rurman  $
  '  $Workfile:   version.asp  $
  '  ------------------------------------------------------------
  '  All Rights Reserved.  Copyright (c) 1988-1998 FileNET Corp.
  '  ------------------------------------------------------------
  '%>
<!-- #include file="islogon.asp" -->
<!-- #include file="notimpl.asp" -->

<!-- Get user credentials
  -->
<%
DebugFlag = 0

Ident = Request.QueryString("Ident")

'Panagon IDM Web application uses the Session variable LibraryLogonID to keep track of
'whether the user has logged on.
'Please see logoncall.asp to see how the Session variable LibraryLogonID is set.
LibraryLogonID = Session("LibraryLogonID")
set LibraryObj = Server.CreateObject("IDMObjects.Library")
LibraryObj.LogonID = LibraryLogonID
%>

<!-- Validate that this is an IDM Document Services and not an IDM Image Services -->
<% 
    if LibraryObj.SystemType = Application("idmSysTypeIS") then
%>
<HTML>
    <HEAD>
        <TITLE>View version feature not valid for IDM Image Services</TITLE>
    </HEAD> 
    <BODY>
    You are currently logged into an IDM Imaging Services library and trying to use an IDM Document Services specific page.</a>
    </BODY>
</HTML>
<%
    'We don't want to display any more, because we're on the wrong page
    Response.End
    end if
%>

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<meta name="GENERATOR" content="">
<title>Property View</title>
</head>

<body bgcolor="#FFFFFF">

<%
'Get the document object.  NOTE: Assumes Ident describes a document object.
On Error Resume Next
set FObj = LibraryObj.GetObject(Application("idmObjTypeDocument"), Ident)
if Len(Err.Description) then
    Response.Expires = 0
    Response.Status = "404 Not Found"
    Response.ContentType = "text/plain"
    Response.Write "Document not found: "
    Response.Write Err.Description
    Response.End
end if
%>

<table border="0" cellpadding="4" cellspacing="0">
    <tr>
        <td nowrap>
        <img src="images/ldoc.gif" width="34" height="39">
        <font size="3"><strong><%= Ident %> : <%=Server.HTMLEncode(FObj.Label) %></strong></font>
        </td>
    </tr>
</table>

<SCRIPT LANGUAGE="JavaScript">
<!--
// Submit is called when the View button (icon) is pressed.
function Submit()
{
    VersionIDStr = document.search.VersionID.options[document.search.VersionID.selectedIndex].value;
    parent.location.href = "doccontent.asp?DocID=" + VersionIDStr;
}
//-->
</SCRIPT>

<form name="search">
    <P>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <em><strong>Version : </strong></em></font>

<!-- Build the list of versions for the document -->
    <select name="VersionID" size="1">
<% 
    set oDoc = FObj
    For Each oDocVer In oDoc.Version.Series
        'Place only the non-Archived versions into the list
        if oDocVer.GetState(13) = False then 
%>  
            <option value="<%= oDocVer.ID %>"><%= oDocVer.ID %></option>
<%
        end if
    Next 
%>  
    </select>

    <P><a href="javascript:Submit()"><img alt="View" src="images/viewlink.gif" border=0></a>

</form>
</body>
</html>
